package com.itheima.array;

import java.util.Scanner;
//评委打分

public class Array0 {
    public static void main(String[] args) {


        Scanner sc = new Scanner(System.in);
        int arr[] = new int[6];
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请开始输入第"+(i+1)+"个数");
            int score = sc.nextInt();
            if (score>100){i--;
                System.out.println("您的输入有误,请重新输入");}
        else { arr[i]=score;
            sum+=score;}
        }
        int max= arr[0];
        int min = arr[0];
        for (int i = 0; i < arr.length; i++) {

            if(arr[i]>max){
                max=arr[i];}

                if(arr[i]<min){
                    min=arr[i];
          }
        }
        double avg = (sum-max-min)/(arr.length-2);
        System.out.println("最小值"+min+"最大值"+max) ;
        System.out.println("平均值为"+avg);
    }



}